#ifndef __Thread_Object_H__
#define __Thread_Object_H__

#include <iostream>
#include <pthread.h>
#include <string>
#include "posix_queue.h"

class ThreadObject
{
public:
    ThreadObject();
    ~ThreadObject();
    void setName(std::string x);
    std::string getName();
    void run();
    void join();
    friend void* thread(void* x);
protected:
	virtual void doSomething() = 0;
private:
	pthread_t thread_id_;
	std::string name_;
};

class UserThread : public ThreadObject
{
public:
	UserThread();
	~UserThread();
protected:
	virtual void doSomething();
private:
	posix_queue* posix_queue_;
};

#endif